package com.hsy.crm.web.domain.vo.costOrder;

import com.hsy.crm.web.domain.entity.BaseEntity;
import org.apache.commons.lang3.time.DateUtils;

import java.text.ParseException;

public class CostOrderPageVo extends BaseEntity {

    private Long dateStart;
    private Long dateEnd;
    private String date;

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        String[] dates = date.split("~");
        try {
            dateStart = DateUtils.parseDate(dates[0].trim()+" 00:00:00","yyyy-MM-dd HH:mm:ss").getTime();
            dateEnd = DateUtils.parseDate(dates[1].trim()+" 00:00:00","yyyy-MM-dd HH:mm:ss").getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.date = date;
    }

    public Long getDateStart() {
        return dateStart;
    }

    public void setDateStart(Long dateStart) {
        this.dateStart = dateStart;
    }

    public Long getDateEnd() {
        return dateEnd;
    }

    public void setDateEnd(Long dateEnd) {
        this.dateEnd = dateEnd;
    }
}
